home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / usr / lib / command-not-found < prev    next >
Text File  |  2008-10-15  |  1KB  |  28 lines

  1. #!/usr/bin/python -S
  2. # (c) Zygmunt Krynicki 2005, 2006, 2007, 2008
  3. # Licensed under GPL, see COPYING for the whole text
  4.  
  5. __version__ = "0.2.21"
  6. BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/+source/command-not-found"
  7.  
  8. import CommandNotFound
  9. import sys
  10. from CommandNotFound.util import crash_guard, gettext_wrapper as _
  11. from CommandNotFound import CommandNotFound
  12. from optparse import OptionParser
  13.  
  14. def main():
  15.     parser = OptionParser(version = __version__, usage=_("%prog [options] <command-name>"))
  16.     parser.add_option('-d', '--data-dir', action='store',
  17.                       default="/usr/share/command-not-found",
  18.                       help=_("use this path to locate data fields"))
  19.     parser.add_option('--ignore-installed', '--ignore-installed',
  20.                       action='store_true',  default=False,
  21.                       help=_("ignore local binaries and display the available packages"))
  22.     (options, args) = parser.parse_args()
  23.     if len(args) == 1:
  24.         CommandNotFound(options.data_dir).advise(args[0], options.ignore_installed)
  25.  
  26. if __name__ == "__main__":
  27.     crash_guard(main, BUG_REPORT_URL, __version__)
  28.